import re
replace_value=re.sub('\d{4}$','0000','13435423143')
print(replace_value)
replace_value=re.sub('#.*$','','num = 0 #a number')
print(replace_value)